//
//  ViewController.swift
//  07-FMDB基本使用
//
//  Created by J on 16/7/31.
//  Copyright © 2016年 J. All rights reserved.
//

import UIKit
import FMDB
class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        SQLiteManager.shareInstance
        
    
    }
    
    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
        let stu = Student(name: "张三", age: 9)
        stu.insertHistory()
        Student.loadStudent()
        
        
//        let sql = "update t_history set age = 500 where name = '张三'"

//        SQLiteManager.shareInstance.db.inTransaction { (db, rollback) in
//            
//            db.executeUpdate(sql, withArgumentsInArray: nil)
//            let num = 0
//            if num == 0{
//                
//                rollback.memory = true
//                return
//            }
//            
//            print("执行")
//            db.executeUpdate(sql, withArgumentsInArray: nil)
//        }
        
        
    }
    
    


}

